<?php
declare(strict_types=1);

namespace App\AdminApi\Module\System\Crontab;

use App\AdminApi\Module\System\Service\ResourcesChunkService;
use Hyperf\Crontab\Annotation\Crontab;
use Hyperf\Di\Annotation\Inject;

/**
 * 资源相关定时任务
 */
class ResourcesCrontab
{
    #[Inject]
    protected ResourcesChunkService $serve;


    #[Crontab(rule: "*/30 * * * *", name: "resources.fragment", memo: "删除本地大文件上传失败或意外操作产生的文件碎片,30分钟执行一次")]
    public function setLogAscription(): void
    {
        $this->serve->clearFileFragment();
    }
}